package com.ziyueyuwen.xiniao.service;

import com.alibaba.fastjson.JSONObject;
import com.ziyueyuwen.xiniao.bean.homework.SubjectQuestionExistElementData;
import com.ziyueyuwen.xiniao.bean.homework.ZySubjectQuestionDO;

import java.util.HashMap;
import java.util.List;

/**
 * @author jun 2018/12/20.
 */
public interface SubjectQuestionService {
    /**
     * 添加数据
     *
     * @param zySubjectQuestionDO ZySubjectQuestionDO
     * @return Boolean
     */
    Boolean add(ZySubjectQuestionDO zySubjectQuestionDO);

    /**
     * 根据套题id, 获取题目数据
     *
     * @param subjectId Integer
     * @return List<ZySubjectQuestionDO>
     */
    List<ZySubjectQuestionDO> listBySubjectId(Integer subjectId);

    /**
     * 根据题目id获取数据
     *
     * @param id Integer
     * @return ZySubjectQuestionDO
     */
    ZySubjectQuestionDO getById(Integer id);

    /**
     * 根据套题id和作业次数获取数据
     *
     * @param subjectId     Integer
     * @param homeworkIndex Integer
     * @return ZySubjectQuestionDO
     */
    ZySubjectQuestionDO getBySubjectIdAndHomeworkIndex(Integer subjectId, Integer homeworkIndex);

    /**
     * 获取每套题的课前回顾, 课后总结等信息是否存在
     *
     * @param subjectId Integer
     * @return HashMap
     */
    HashMap<Integer, SubjectQuestionExistElementData> getSubjectQuestionExistElementDataInfoBySubjectId(Integer subjectId);

    /**
     * 保存套题, 将原数据保存成学生做题的数据格式. 套题不存在时添加, 存在时则修改
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @param answerOrder String
     * @throws Exception Exception
     */
    void saveSubjectQuestion(Integer courseId, Integer lessonIndex, String answerOrder) throws Exception;

    /**
     * 获取作答要求
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @return JSONObject
     * @throws Exception Exception
     */
    JSONObject getAnswerOrder(Integer courseId, Integer lessonIndex) throws Exception;

    /**
     * 获取模板列表
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @return List
     * @throws Exception Exception
     */
    List<String> listMould(Integer courseId, Integer lessonIndex) throws Exception;

    /**
     * 获取标签列表
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @return List
     * @throws Exception Exception
     */
    List<String> listTag(Integer courseId, Integer lessonIndex) throws Exception;

    /**
     * 获取课中互动的限时数组
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @return List
     * @throws Exception Exception
     */
    List<Integer> listClassroomTestLimitTime(Integer courseId, Integer lessonIndex) throws Exception;

    /**
     * 保存模板数据
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @param mouldList   List
     * @throws Exception Exception
     */
    void saveMouldList(Integer courseId, Integer lessonIndex, List<String> mouldList) throws Exception;

    /**
     * 保存标签数据
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @param tagList     List
     * @throws Exception Exception
     */
    void saveTagList(Integer courseId, Integer lessonIndex, List<String> tagList) throws Exception;

    /**
     * 获取知识点梗概
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @return String
     * @throws Exception Exception
     */
    String getPointGist(Integer courseId, Integer lessonIndex) throws Exception;

    /**
     * 保存知识点梗概
     *
     * @param courseId    Integer
     * @param lessonIndex Integer
     * @param pointGist   String
     * @throws Exception Exception
     */
    void savePointGist(Integer courseId, Integer lessonIndex, String pointGist) throws Exception;

    /**
     * 获取课中互动题目
     *
     * @param eeoClassId Integer
     * @return JSONObject
     * @throws Exception Exception
     */
    JSONObject getClassroomTestQuestion(Integer eeoClassId) throws Exception;
}
